﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using YArchitech.LIB;
using YJKCopyModel.Forms;

namespace YJKCopyModel.AxisTransModel
{
	internal class AxisModelResposeHandler : IResponseHanlder
	{
		public void AddEndTime(DateTime inputDataTime)
		{
			this.m_endTime = inputDataTime;
		}

		public void AddOneResponse(RevitModelRebuildResponse inputResponse)
		{
			this.m_lstResponse.Add(inputResponse);
		}

		public void AddStartTime(DateTime inputDataTime)
		{
			this.m_startTime = inputDataTime;
		}

		public void HanlderResponse()
		{
			int num = this.m_lstResponse.Count((RevitModelRebuildResponse item) => item.IfSucess);
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("成功生成轴网实例");
			stringBuilder.Append(num.ToString());
			stringBuilder.Append("个\n");
			stringBuilder.Append("时间：");
			stringBuilder.Append(((int)(this.m_endTime - this.m_startTime).TotalSeconds).ToString());
			stringBuilder.Append("秒");
			Process currentProcess = Process.GetCurrentProcess();
			YJKWindowHandle owner = new YJKWindowHandle(currentProcess.MainWindowHandle);
			TransResultForm transResultForm = new TransResultForm(stringBuilder.ToString());
			transResultForm.ShowDialog(owner);
		}

		private DateTime m_startTime = default(DateTime);

		private DateTime m_endTime = default(DateTime);

		private List<RevitModelRebuildResponse> m_lstResponse = new List<RevitModelRebuildResponse>();
	}
}
